//
//  NWHomeNormalCell.swift
//  Weibo01
//
//  Created by 牛威 on 15/12/13.
//  Copyright © 2015年 牛威. All rights reserved.
//

import UIKit

class NWHomeNormalCell: NWHomeCell {
    
    
    
    //设置模型属性
    
   override var arrayM : HMViewModel? {
        
        didSet{
            
            
            
            picture.snp_updateConstraints { (make) -> Void in
                
                
                //判断配图的有无

                let offset = arrayM?.thumbnailUrls?.count > 0 ? TopViewMargin : 0

                make.top.equalTo(contentLabel.snp_bottom).offset(offset)
                
            }
            
        }
        
    }

    
    
    
    override func setupUI() {
        
       super.setupUI()
        
        //设置配图约束
        
        picture.snp_makeConstraints { (make) -> Void in

            make.top.equalTo(contentLabel.snp_bottom).offset(TopViewMargin)
            make.left.equalTo(contentLabel.snp_left)

            make.width.equalTo(300)
            make.height.equalTo(90)
        }
        
    }

}
